<template>
    <require from="./em-dropdown-search.less"></require>
    <div ref="ddRef" class="ui top left pointing dropdown basic button em-dropdown-search">
        <!-- <input type="hidden" name="filters"> -->
        <!-- <i class="filter icon"></i> -->
        <span class="text">${text}</span>
        <i class="dropdown icon"></i>
        <div class="menu">
            <div class="ui icon search input">
                <i class="search icon"></i>
                <input type="text" placeholder="查找${name}">
            </div>
            <a class="clear" click.delegate="clearHandler()" show.bind="checks.length > 0">清除选择的${name}</a>
            <template repeat.for="item of items">
                <div if.bind="item.checked" class="item" data-value="${item.id}" title="${item.description}">
                    <div ref="chkRef" class="ui checkbox" task.bind="initCheckboxHandler(item, chkRef)">
                        <input type="checkbox">
                        <label>${item.name}${item.key ? ' (' + item.key + ')' : ''}</label>
                    </div>
                </div>
            </template>
            <div class="divider"></div>
            <div class="header">
                所有${name}
            </div>
            <div class="scrolling menu">
                <template repeat.for="item of items">
                    <div if.bind="!item.checked" class="item" data-value="${item.id}" title="${item.description}">
                        <div ref="chkRef" class="ui checkbox" task.bind="initCheckboxHandler(item, chkRef)">
                            <input type="checkbox">
                            <label>${item.name}${item.key ? ' (' + item.key + ')' : ''}</label>
                        </div>
                    </div>
                </template>
            </div>
        </div>
    </div>
</template>
